package com.sky.mapper;

import com.sky.dto.SetmealPageQueryDTO;
import com.sky.entity.Setmeal;
import com.sky.vo.SetmealVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface SetmealMapper {

    void save(Setmeal setmeal);

    List<SetmealVO> page(SetmealPageQueryDTO dto);

    void remove(List<Integer> ids);

    @Select("select * from setmeal where id=#{id}")
    Setmeal getById(Integer id);

    SetmealVO getAllById(Integer id);

    void update(Setmeal setmeal);

    @Update("update setmeal set status=#{status} where id=#{id}")
    void updateStatus(Integer status,Integer id);


    @Select("select * from setmeal where category_id=#{categoryId}")
    List<Setmeal> listBycategoryId(Integer categoryId);
}